package com.xcesys.extras.dataobject.system;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

import com.xcesys.extras.dataobject.EditableObject;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "User")
public class User extends EditableObject implements java.io.Serializable {
	private static final long serialVersionUID = -5476946714386941383L;
	@XmlAttribute(name = "AccountExpired")
	private Boolean accountExpired;
	@XmlAttribute(name = "AccountExpiredDate")
	private Date accountExpiredDate;
	@XmlAttribute(name = "AccountLocked")
	private Boolean accountLocked;
	private String algorithm = "sha1";
	@XmlAttribute(name = "Authtype")
	private String authtype;
	private String confirmPassword;
	@XmlAttribute(name = "CredentialExpired")
	private Boolean credentialExpired;
	@XmlAttribute(name = "CredentialExpiredDate")
	private Date credentialExpiredDate;
	@XmlAttribute(name = "Email")
	private String email;
	private Boolean enabled = Boolean.TRUE;
	private String gender;
	private UserInfo info;
	private Date lastLogin;
	private Integer loginCount;
	private String mobilePhone;
	private String nickName;
	@XmlAttribute(name = "Password")
	private String password;
	@XmlAttribute(name = "PasswordHint")
	private String passwordHint;
	private Set<Role> roles = new HashSet<Role>(0);
	private String salt;
	private Boolean superAdmin = Boolean.FALSE;
	@XmlAttribute(name = "Usertype")
	private String type;
	@XmlAttribute(name = "Username")
	private String username;
	private Set<User> users = new HashSet<User>(0);
	// Add for TsUserstatus table.
	private String validCode;
	private Date validDate;
	private Boolean validEmail = Boolean.FALSE;
	private Boolean validMobilePhone = Boolean.FALSE;
	private Long deptId;
	private String deptName;
	private String deptNo;
	private Long divisionId;
	private String divisionName;
	private String divisionNo;

	public User() {
	}

	public Boolean getAccountExpired() {
		return accountExpired;
	}

	public Date getAccountExpiredDate() {
		return accountExpiredDate;
	}

	public Boolean getAccountLocked() {
		return accountLocked;
	}

	public String getAlgorithm() {
		return algorithm;
	}

	public String getAuthtype() {
		return authtype;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public Boolean getCredentialExpired() {
		return credentialExpired;
	}

	public Date getCredentialExpiredDate() {
		return credentialExpiredDate;
	}

	public Long getDeptId() {
		return deptId;
	}

	public String getDeptName() {
		return deptName;
	}

	public String getDeptNo() {
		return deptNo;
	}

	public Long getDivisionId() {
		return divisionId;
	}

	public String getDivisionName() {
		return divisionName;
	}

	public String getDivisionNo() {
		return divisionNo;
	}

	public String getEmail() {
		return email;
	}

	public Boolean getEnabled() {
		return enabled;
	}

	public String getGender() {
		return gender;
	}

	public UserInfo getInfo() {
		return info;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public Integer getLoginCount() {
		return loginCount;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public String getNickName() {
		return nickName;
	}

	public String getPassword() {
		return password;
	}

	public String getPasswordHint() {
		return passwordHint;
	}

	public Set<Role> getRoles() {
		return roles;
	}

	public String getSalt() {
		return salt;
	}

	public Boolean getSuperAdmin() {
		return superAdmin;
	}

	public String getType() {
		return type;
	}

	public String getUsername() {
		return username;
	}

	public Set<User> getUsers() {
		return users;
	}

	public String getValidCode() {
		return validCode;
	}

	public Date getValidDate() {
		return validDate;
	}

	public Boolean getValidEmail() {
		return validEmail;
	}

	public Boolean getValidMobilePhone() {
		return validMobilePhone;
	}

	public void setAccountExpired(Boolean accountExpired) {
		Object oldValue = this.accountExpired;
		this.accountExpired = accountExpired;
		firePropertyChange("accountExpired", oldValue, accountExpired);
	}

	public void setAccountExpiredDate(Date accountExpiredDate) {
		Object oldValue = this.accountExpiredDate;
		this.accountExpiredDate = accountExpiredDate;
		firePropertyChange("accountExpiredDate", oldValue, accountExpiredDate);
	}

	public void setAccountLocked(Boolean accountLocked) {
		Object oldValue = this.accountLocked;
		this.accountLocked = accountLocked;
		firePropertyChange("accountLocked", oldValue, accountLocked);
	}

	public void setAlgorithm(String algorithm) {
		Object oldValue = this.algorithm;
		this.algorithm = algorithm;
		firePropertyChange("algorithm", oldValue, algorithm);
	}

	public void setAuthtype(String authtype) {
		Object oldValue = this.authtype;
		this.authtype = authtype;
		firePropertyChange("authtype", oldValue, authtype);
	}

	public void setConfirmPassword(String confirmPassword) {
		Object oldValue = this.confirmPassword;
		this.confirmPassword = confirmPassword;
		firePropertyChange("confirmPassword", oldValue, confirmPassword);
	}

	public void setCredentialExpired(Boolean credentialExpired) {
		Object oldValue = this.credentialExpired;
		this.credentialExpired = credentialExpired;
		firePropertyChange("credentialExpired", oldValue, credentialExpired);
	}

	public void setCredentialExpiredDate(Date credentialExpiredDate) {
		Object oldValue = this.credentialExpiredDate;
		this.credentialExpiredDate = credentialExpiredDate;
		firePropertyChange("credentialExpiredDate", oldValue,
				credentialExpiredDate);
	}

	public void setDeptId(Long deptId) {
		Object oldValue = this.deptId;
		this.deptId = deptId;
		firePropertyChange("deptId", oldValue, deptId);
	}

	public void setDeptName(String deptName) {
		Object oldValue = this.deptName;
		this.deptName = deptName;
		firePropertyChange("deptName", oldValue, deptName);
	}

	public void setDeptNo(String deptNo) {
		Object oldValue = this.deptNo;
		this.deptNo = deptNo;
		firePropertyChange("deptNo", oldValue, deptNo);
	}

	public void setDivisionId(Long divisionId) {
		Object oldValue = this.divisionId;
		this.divisionId = divisionId;
		firePropertyChange("divisionId", oldValue, divisionId);
	}

	public void setDivisionName(String divisionName) {
		Object oldValue = this.divisionName;
		this.divisionName = divisionName;
		firePropertyChange("divisionName", oldValue, divisionName);
	}

	public void setDivisionNo(String divisionNo) {
		Object oldValue = this.divisionNo;
		this.divisionNo = divisionNo;
		firePropertyChange("divisionNo", oldValue, divisionNo);
	}

	public void setEmail(String email) {
		Object oldValue = this.email;
		this.email = email;
		firePropertyChange("email", oldValue, email);
	}

	public void setEnabled(Boolean enabled) {
		Object oldValue = this.enabled;
		this.enabled = enabled;
		firePropertyChange("enabled", oldValue, enabled);
	}

	public void setGender(String gender) {
		Object oldValue = this.gender;
		this.gender = gender;
		firePropertyChange("gender", oldValue, gender);
	}

	public void setInfo(UserInfo info) {
		Object oldValue = this.info;
		this.info = info;
		firePropertyChange("info", oldValue, info);
	}

	public void setLastLogin(Date lastLogin) {
		Object oldValue = this.lastLogin;
		this.lastLogin = lastLogin;
		firePropertyChange("lastLogin", oldValue, lastLogin);
	}

	public void setLoginCount(Integer loginCount) {
		Object oldValue = this.loginCount;
		this.loginCount = loginCount;
		firePropertyChange("loginCount", oldValue, loginCount);
	}

	public void setMobilePhone(String mobilePhone) {
		Object oldValue = this.mobilePhone;
		this.mobilePhone = mobilePhone;
		firePropertyChange("mobilePhone", oldValue, mobilePhone);
	}

	public void setNickName(String nickName) {
		Object oldValue = this.nickName;
		this.nickName = nickName;
		firePropertyChange("nickName", oldValue, nickName);
	}

	public void setPassword(String password) {
		Object oldValue = this.password;
		this.password = password;
		firePropertyChange("password", oldValue, password);
	}

	public void setPasswordHint(String passwordHint) {
		Object oldValue = this.passwordHint;
		this.passwordHint = passwordHint;
		firePropertyChange("passwordHint", oldValue, passwordHint);
	}

	public void setRoles(Set<Role> roles) {
		Object oldValue = this.roles;
		this.roles = roles;
		firePropertyChange("roles", oldValue, roles);
	}

	public void setSalt(String salt) {
		Object oldValue = this.salt;
		this.salt = salt;
		firePropertyChange("salt", oldValue, salt);
	}

	public void setSuperAdmin(Boolean superAdmin) {
		Object oldValue = this.superAdmin;
		this.superAdmin = superAdmin;
		firePropertyChange("superAdmin", oldValue, superAdmin);
	}

	public void setType(String type) {
		Object oldValue = this.type;
		this.type = type;
		firePropertyChange("type", oldValue, type);
	}

	public void setUsername(String username) {
		Object oldValue = this.username;
		this.username = username;
		firePropertyChange("username", oldValue, username);
	}

	public void setUsers(Set<User> users) {
		Object oldValue = this.users;
		this.users = users;
		firePropertyChange("users", oldValue, users);
	}

	public void setValidCode(String validCode) {
		Object oldValue = this.validCode;
		this.validCode = validCode;
		firePropertyChange("validCode", oldValue, validCode);
	}

	public void setValidDate(Date validDate) {
		Object oldValue = this.validDate;
		this.validDate = validDate;
		firePropertyChange("validDate", oldValue, validDate);
	}

	public void setValidEmail(Boolean validEmail) {
		Object oldValue = this.validEmail;
		this.validEmail = validEmail;
		firePropertyChange("validEmail", oldValue, validEmail);
	}

	public void setValidMobilePhone(Boolean validMobilePhone) {
		Object oldValue = this.validMobilePhone;
		this.validMobilePhone = validMobilePhone;
		firePropertyChange("validMobilePhone", oldValue, validMobilePhone);
	}

}
